The invention pertains to computer graphics and, more particularly, to methods for analyzing the generation of graphical images. The invention has application, for example, in facilitating the tuning and optimization of three-dimensional graphics software.
Computers have long been used to generate graphical images. Though early computer systems were capable of imaging in only two dimensions, they found ready acceptance in automated drafting, cartography, and the like. By the mid-1970's, three-dimensional graphics systems became commercially available. The systems tended to be quite expensive, requiring dedicated hardware and custom software.
Over the years standardized graphical programming interfaces and libraries have become readily available in the marketplace. Applications programs can now be written to generate three-dimensional images by calling subroutines (or functions) provided in industry-standard graphics libraries, such as those complying with the "OpenGL" specification. The relative ease with which graphics can be generated has led to a proliferation of graphics applications, e.g., for business, technical and scientific simulation, user interfaces, and animation.
Computer generation of graphical images, particularly, three-dimensional images, is a computationally intensive task. Even for a simple wire frame image, in which only the edges of an object are drawn, numerous mathematical calculations are required, e.g., to give the object perspective and to display it from the vantagepoint of the viewer. The numbers of calculations increase dramatically when objects are imaged as solid bodies, that is, when their surfaces (rather than merely their edges) are rendered. In those instances, the systems must take into account hidden surfaces, color, shading, texture, illumination, and other attributes of the object and its surfaces.
A common technique for imaging three-dimensional solid bodies is by constructing complex surfaces from "primitive" geometric shapes, such as lines, triangles, squares and other polyhedrons. An image of a desk, for example, may be rendered by drawing tens or hundreds of thousands of small line segments and triangles, placed side-by-side and individually textured to represent corresponding surfaces of the actual desk.
The sheer numbers of primitives required for a typical scene can make debugging or other analyses of the rendering process quite difficult. If a scene takes too long to render, a programmer could attempt to track all of the calls made by the underlying applications program to the graphics library. Unfortunately, the numbers of graphics calls made in drawing a scene can be several factors larger than the number of primitives themselves. Tracking that many calls in a meaningful way, though sometimes necessary, can be virtually impossible.
The prior art provides some assistance in this regard. Some conventional graphics packages permit graphics usage to be cataloged by the types of primitives rendered. Such an analysis, for example, might reveal that a graphics program for drawing a desk rendered thirty thousand line segment primitives and twenty-five thousand triangles primitives. Though sometimes sufficient, even this analysis is not adequate to enable the programmer to analyze a graphics program qualitatively and quantitatively.
An object of this invention is to facilitate improvements in the quality and performance of computer graphics applications. A more particular object is to provide methods for determining the image generating characteristics of such applications programs.
A related object of the invention is to provide improved methods of analyzing the usage of a library of graphics routines for debugging, tuning or optimizing the generation of images.
Yet another object is to provide such methods for use in analyzing executing computer programs, as well as those that are in source code format.
Yet still another object of the invention is to provide such methods for use in analyzing computer programs that generate three-dimensional images.